package com.jjsj.mall.shop.service.impl;

import com.jjsj.mall.shop.entity.YoshopOrderAddress;
import com.jjsj.mall.shop.mapper.YoshopOrderAddressMapper;
import com.jjsj.mall.shop.service.IYoshopOrderAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单地址Service业务层处理
 *
 * @author www.joolun.com
 * @date 2022-10-24
 */
@Service
public class YoshopOrderAddressServiceImpl implements IYoshopOrderAddressService {
    @Autowired
    private YoshopOrderAddressMapper yoshopOrderAddressMapper;

    /**
     * 查询订单地址
     *
     * @param orderAddressId 订单地址ID
     * @return 订单地址
     */
    @Override
    public YoshopOrderAddress selectYoshopOrderAddressById(String orderAddressId) {
        return yoshopOrderAddressMapper.selectYoshopOrderAddressById(orderAddressId);
    }

    /**
     * 查询订单地址列表
     *
     * @param yoshopOrderAddress 订单地址
     * @return 订单地址
     */
    @Override
    public List<YoshopOrderAddress> selectYoshopOrderAddressList(YoshopOrderAddress yoshopOrderAddress) {
        return yoshopOrderAddressMapper.selectYoshopOrderAddressList(yoshopOrderAddress);
    }

    /**
     * 新增订单地址
     *
     * @param yoshopOrderAddress 订单地址
     * @return 结果
     */
    @Override
    public int insertYoshopOrderAddress(YoshopOrderAddress yoshopOrderAddress) {
        return yoshopOrderAddressMapper.insertYoshopOrderAddress(yoshopOrderAddress);
    }

    /**
     * 修改订单地址
     *
     * @param yoshopOrderAddress 订单地址
     * @return 结果
     */
    @Override
    public int updateYoshopOrderAddress(YoshopOrderAddress yoshopOrderAddress) {
        return yoshopOrderAddressMapper.updateYoshopOrderAddress(yoshopOrderAddress);
    }

    /**
     * 批量删除订单地址
     *
     * @param orderAddressIds 需要删除的订单地址ID
     * @return 结果
     */
    @Override
    public int deleteYoshopOrderAddressByIds(String[] orderAddressIds) {
        return yoshopOrderAddressMapper.deleteYoshopOrderAddressByIds(orderAddressIds);
    }

    /**
     * 删除订单地址信息
     *
     * @param orderAddressId 订单地址ID
     * @return 结果
     */
    @Override
    public int deleteYoshopOrderAddressById(String orderAddressId) {
        return yoshopOrderAddressMapper.deleteYoshopOrderAddressById(orderAddressId);
    }
}
